package cn.stylefeng.guns.modular.system.service;

import cn.stylefeng.guns.modular.system.entity.Rent;
import cn.stylefeng.guns.modular.system.mapper.RentMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 管理员表 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2018-12-07
 */
@Service
public class RentService extends ServiceImpl<RentMapper, Rent> {



    public void insertRecord(Long userId, Long carId) {
        this.baseMapper.insertRecord(userId, carId);
    }

    public Long selectRecord(Long userId){
        return this.baseMapper.selectRecord(userId);
    }

    public void deleteRecord(Long userId) {
        this.baseMapper.deleteRecord(userId);
    }

    public List<Map<String, Object>> selectRents(Long userId) {
        return this.baseMapper.selectRents(userId);
    }

    public Rent selectRent(Long userId) {
        return this.baseMapper.selectRent(userId);
    }

    public boolean updateByUserId(Rent rent) {
        return this.baseMapper.updateByUserId(rent);
    }

    public List<Map<String, Object>> selectRentsByCar(Long carId) {
        return this.baseMapper.selectRentsByCar(carId);
    }
}
